package cate.common.table.item.hero;

import cate.common.annotation.SplitParse;
import cate.common.util.SplitParser;
import cate.common.util.random.RWItem;
import cate.common.util.random.RWList;

import java.util.List;

/** 英雄召唤之星组配置 */
public class StarGroupList extends RWList<StarGroupList.Item> {

    public void parse(String config) {
        List<Item> l = SplitParser.parse(Item.class, config);
        this.setup(l);
    }

    public static class Item implements RWItem {
        @SplitParse(order = 0, note = "星组ID")
        public int groupId;

        @SplitParse(order = 1, note = "权重", defaultValue = "1.0")
        public double weight;

        @SplitParse(order = 2, note = "策略，1木桶 2常规")
        public byte type;

        @Override
        public double getWeight() {
            return weight;
        }
    }

    public static final byte TYPE_BUCKET = 1;
    public static final byte TYPE_GENERAL = 2;
}
